package java_objects.method_arguments;

public class SwapObjectValues {

	Point point1 = new Point(10,20);
	Point point2 = new Point(30,40);

	void swap(Point p1, Point p2) {
		Point temp = new Point(p1.x,p1.y);
		
		p1.x = p2.x;
		p1.y = p2.y;

		p2.x = temp.x;
		p2.y = temp.y;
	}
	void swapTest() {
		swap(point1, point2);
		System.out.print("Point 1 :");
		point1.print();
		System.out.print("Point 2 :");
		point2.print();
		
	}

	public static void main(String[] args) {
		new SwapObjectValues().swapTest();
	}
}
